from rest_framework import serializers
from .models import Banner, Nav


class BannerModelSerializer(serializers.ModelSerializer):
    """轮播图序列化器"""

    class Meta:
        model = Banner
        fields = ["image", "link"]


class NavModelSerializer(serializers.ModelSerializer):
    """导航菜单的序列化器"""

    class Meta:
        model = Nav
        fields = ['name', 'link', 'position', 'is_http']